package io.gitee.zicai.bus.publish;

import com.google.common.eventbus.AsyncEventBus;
import io.gitee.zicai.bus.support.GuavaEvent;

import javax.annotation.Resource;

/**
 * GuavaBusPublisher
 *
 * @author zicai
 * @since 2021-01-22
 */
public class GuavaBusPublisher<B extends GuavaEvent> implements IBusPublisher<B> {

    @Resource
    @SuppressWarnings("UnstableApiUsage")
    private AsyncEventBus asyncEventBus;

    @Override
    @SuppressWarnings("UnstableApiUsage")
    public void publish(B bus) {
        asyncEventBus.post(bus);
    }

}
